package org.scboy.common.controller;

import org.scboy.common.beans.DynamicServiceResult;
import org.scboy.common.service.DynamicService;
import org.scboy.utils.entitys.coobi.Model;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Configuration
@RestController
@RequestMapping("/dynamic/service")
public class DynamicServiceController {

	@Autowired
	DynamicService service;
	
	/**
	 * 动态服务
	 * @return
	 */
	@PostMapping("/{code}")
	public DynamicServiceResult dynamicServiceExe(@RequestBody Model params,@PathVariable("code")String code){
		DynamicServiceResult result=(DynamicServiceResult)service.dynamicServiceExe(code, params);
		return result;
	}
}
